import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86186
 * Date: 2023-10-04
 * Time: 22:06
 */
public class Demo4 {
    public static void main(String[] args) {
        try (OutputStream outputStream = new FileOutputStream("d:/test2.txt")) {
            String s = "我爱中国";
            outputStream.write(s.getBytes());
        } catch (FileNotFoundException e) {
            throw new RuntimeException(e);
        } catch (IOException e) {
            throw new RuntimeException(e);
        } ;
    }
}
